<%--
  Created by IntelliJ IDEA.
  User: whb
  Date: 2024/1/22
  Time: 9:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>容器操作</title>
</head>
<body>
<%
    pageContext.setAttribute("A", "page内容");
    request.setAttribute("A", "request内容");
    session.setAttribute("A", "session内容");
    application.setAttribute("A", "application内容");
%>
<h2>小脚本方式</h2>
<%
    Object a = pageContext.getAttribute("A", 1);
    Object b = request.getAttribute("A");
    Object c = session.getAttribute("A");
    Object d = application.getAttribute("A");
    out.print("page:" + a + "<br/>");
    out.print("request:" + b + "<br/>");
    out.print("session:" + c + "<br/>");
    out.print("application:" + d + "<br/>");
%>
<h2>表达式方式</h2>
page:<%=a%><br/>
request:<%=b%><br/>
session:<%=c%><br/>
application:<%=d%><br/>
<h2>EL表达式</h2>
page:${pageScope.A}<br/>
request:${requestScope.A}<br/>
session:${sessionScope.A}<br/>
application:${applicationScope.A}<br/>
简化：${A}
</body>
</html>
